﻿using System;
using System.IO;
using System.Collections.Generic;
using ConsoleTools;

namespace ConsoleApp1
{
    class Program
    {
        public static void PrintArray(string [] arr)
        {
            int length = arr.Length;
            for (int i = 0; i < length; i++)
            {
                Console.WriteLine(arr[i]);

            }
        }
        public static Array  PrintTypes<T>()
        {
            T[] arr = new T[] { };
            return   arr;
        }
        public static void PrintArgs(string [] args)
        {
            foreach(string st in args)
            {
                Console.Write(st);
            }
        }
        static void Main(string[] args)
        {
            var arguments = CommandLineArgumentParser.Parse(args);
            if (arguments.Has("-p"))
            {
                Console.WriteLine("文件路径：{0}", arguments.Get("-p").Next);
                string path = arguments.Get("-p").Next;
                string[] directorys = Directory.GetDirectories(path);
                string[] files = Directory.GetDirectories(path);

                var directoryInfo = new DirectoryInfo(path);
                DirectoryInfo[] directoryInfos = directoryInfo.GetDirectories();

                Console.WriteLine("文件夹:");
                PrintArray(directorys);
                Console.WriteLine("文件:");
                PrintArray(files);
            }
             
            
            Console.ReadLine();
        }
    }
}
